import throttle from './throttle.js'

window.onscroll = throttle(function() {
  let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
  let el = document.getElementById('h-header')
  if (el) {
    if (scrollTop > 0) {
      if (el.style.boxShadow === 'none') {
        el.style.boxShadow = '0 1px 6px 2px #efefef'
      }
    } else {
      document.getElementById('h-header').style.boxShadow = 'none'
    }
  }
}, 500, 1000)
